package com.haulmont.asu.web.ui.commission_member_role;

import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 28.11.13 13:20
 */
public class CommissionMemberRoleBrowser extends AbstractLookup {

    @Inject
    protected Table roleTable;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        roleTable.removeAction(getAction("roleTable.create"));
        roleTable.addAction(new CreateAction(roleTable, WindowManager.OpenType.DIALOG));

        roleTable.removeAction(getAction("roleTable.edit"));
        roleTable.addAction(new EditAction(roleTable, WindowManager.OpenType.DIALOG));
    }
}
